In a resistance switching metal oxide layer which is sandwiched between upper and lower electrodes and contains nickel (Ni) and oxygen (O) and in which the concentration of O increases from the lower electrode toward the upper electrode, O in the resistance switching metal oxide layer diffuses by Joule heat when an electric current flows from the upper electrode to the lower electrode, thereby locally forming a heavily doped Ni portion. In this structure, it is difficult to control a resistance change because the concentration of O in the resistance switching metal oxide is nonuniform.